package cn.com.mapper;

import cn.com.beans.CollegeInfo;
import cn.com.beans.News;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface NewsMapper {
    /**
     * delete by primary key
     *
     * @param nId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer nId);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(News record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(News record);

    /**
     * select by primary key
     *
     * @param nId primary key
     * @return object by primary key
     */
    News selectByPrimaryKey(Integer nId);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(News record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(News record);

    /**
     * 查询所有新闻资讯
     * @return
     */
    List<News> findAllnews();

    /**
     * 根据ID查新闻
      * @param nid
     * @return
     */
    News findNewById(Integer nid);

    /**
     * 根据种类查新闻
     * @param nCategory
     * @return
     */
    List<News> findNewsByType(Integer nCategory);


}